<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			this.refreshUserInfo();
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			refreshUserInfo() {
				const userinfo = uni.getStorageSync('userInfo')
				if (userinfo._id) {
					const obj = uniCloud.importObject('users')
					const result = obj.getUserInfobyId({
						_id: userinfo._id
					}).then(res => {
						if (res.code === 0) {
							uni.setStorageSync('userInfo', res.data)
							// console.log('用户信息已更新');
						}
					})
				}
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>